package cn.jk.config;

import org.springframework.context.MessageSource;
import org.springframework.context.MessageSourceResolvable;
import org.springframework.context.NoSuchMessageException;
import org.springframework.stereotype.Component;

import java.util.Locale;

/**
 * 国际化标准接口
 * 如 中英文对照内容的返回，具体使用方法再百度把
 */
public class MyMessageSource implements MessageSource {
	@Override
	public String getMessage(String code, Object[] args, String defaultMessage, Locale locale) {
		return "哈哈哈1";
	}

	@Override
	public String getMessage(String code, Object[] args, Locale locale) throws NoSuchMessageException {
		return "哈哈哈2";
	}

	@Override
	public String getMessage(MessageSourceResolvable resolvable, Locale locale) throws NoSuchMessageException {
		return "哈哈哈3";
	}
}
